package com.crm.entity;

import java.util.Date;



import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.GenericGenerator;

@Entity 
@Table(name = "attachment_history")
public class AttachmentHistory {

	
	@Id
	@GeneratedValue(generator="increment")
	@GenericGenerator(name="increment", strategy = "increment")
	@Column(name="id")
	private  int id;
	
	@Column(name="file_type")
	private String fileType;
	
	@ManyToOne
	@JoinColumn(name="BUSINESS_ID")
	private Business businessId;
	
	@Column(name="file_name")
	private String fileName;
	
	@Column(name="file_blob")
	private byte[] fileBlob;

	@Column(name="enqno")
	private String enqNO;

	@Column(name="refno")
	private String refNo;
	  @Temporal(TemporalType.TIMESTAMP)
	    @Column(name = "createddate", nullable = false)
    private  Date CreatedDate;
    
  public AttachmentHistory(){};
    
	public AttachmentHistory(String fileType, Business businessId,
			String fileName, byte[] fileBlob, String enqNO, String refNo,
			Date createdDate) {
		super();
		this.fileType = fileType;
		this.businessId = businessId;
		this.fileName = fileName;
		this.fileBlob = fileBlob;
		this.enqNO = enqNO;
		this.refNo = refNo;
		CreatedDate = createdDate;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getFileType() {
		return fileType;
	}
	public void setFileType(String fileType) {
		this.fileType = fileType;
	}
	public Business getBusinessId() {
		return businessId;
	}
	public void setBusinessId(Business businessId) {
		this.businessId = businessId;
	}
	public String getFileName() {
		return fileName;
	}
	public void setFileName(String fileName) {
		this.fileName = fileName;
	}
	public byte[] getFileBlob() {
		return fileBlob;
	}
	public void setFileBlob(byte[] fileBlob) {
		this.fileBlob = fileBlob;
	}
	public String getEnqNO() {
		return enqNO;
	}
	public void setEnqNO(String enqNO) {
		this.enqNO = enqNO;
	}
	public String getRefNo() {
		return refNo;
	}
	public void setRefNo(String refNo) {
		this.refNo = refNo;
	}
	public Date getCreatedDate() {
		return CreatedDate;
	}
	public void setCreatedDate(Date createdDate) {
		CreatedDate = createdDate;
	}
    
	
	
    
}
